package com.truing.flycodebill.workbench.service.impl;


import com.truing.flycodebill.workbench.domain.Bill;
import com.truing.flycodebill.workbench.mapper.BillMapper;
import com.truing.flycodebill.workbench.service.BillService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@Service("billService")
public class BillServiceImpl implements BillService {

    @Resource
    private BillMapper billMapper;


    @Override
    public int saveCreateBill(Bill bill) {
        return billMapper.insertBill(bill);
    }

    @Override
    public List<Bill> selectBillByConditionForPage(Map<String, Object> map) {
        return billMapper.selectBillByConditionForPage(map);
    }

    @Override
    public int selectCountOfBillByCondition(Map<String, Object> map) {
        return billMapper.selectCountBillByCondition(map);
    }

    @Override
    public int deleteBillByIds(String[] ids) {
        return billMapper.deleteBillByIds(ids);
    }

    @Override
    public Bill queryBillById(String id) {
        return billMapper.selectBillById(id);
    }

    @Override
    public int saveEditBill(Bill bill) {
        return billMapper.updateBill(bill);
    }

    @Override
    public List<Bill> queryBillByOwnerId(String ownerId) {
        return billMapper.selectBillsByOwnerId(ownerId);
    }

    @Override
    public List<Bill> queryByIds(String[] ids) {
        return billMapper.selectBillByIds(ids);
    }

    @Override
    public List<Bill> queryBillByBillTime(Map<String, Object> map) {
        return billMapper.selectBillByBillTime(map);
    }

    @Override
    public List<Bill> queryBillByBillTimeAndType(Map<String, Object> map) {
        return billMapper.selectBillByTimeAndType(map);
    }

    @Override
    public int queryCountOfBills() {
        return billMapper.selectCountOfBills();
    }

    @Override
    public int queryCountOfBillsByTypeId(String typeId) {
        return billMapper.selectCountOfBillsByTypeId(typeId);
    }

    @Override
    public List<Bill> queryTopFiveBills() {
        return billMapper.selectTopFiveBills();
    }

    @Override
    public List<Bill> queryBillsByTitle(String title) {
        return billMapper.selectBillByTitle(title);
    }

    @Override
    public List<Bill> queryBillsByTypeId(Map<String, Object> map) {
        return billMapper.selectBillByTypeId(map);
    }
}
